package app.vendorportal.api.marketplace.data.request;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author Bribin
 * @createdDate Oct 11, 2013
 */
@XmlRootElement(name = "query-delivery-date-request")
@XmlAccessorType(XmlAccessType.FIELD)
public class QueryDeliveryDateRequest {

    @NotNull(message = "order date is required")
    @XmlElement(name = "order-date")
    private Date orderDate;

    @NotEmpty(message = "zip code is required")
    @XmlElement(name = "zip-code")
    private String zipCode;

    @Valid
    @NotEmpty(message = "warehouse code can't be empty")
    @XmlElementWrapper(name = "warehouse-code-list")
    @XmlElement(name = "warehouse-code")
    private final List<String> warehouseCodes = new ArrayList<String>();

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public List<String> getWarehouseCodes() {
        return warehouseCodes;
    }

}
